package com.vf.admin.platform.service.impl;

import com.vf.admin.platform.dao.RoleMenuElementDao;
import com.vf.admin.platform.entity.Element;
import com.vf.admin.platform.entity.RoleMenu;
import com.vf.admin.platform.entity.RoleMenuElement;
import com.vf.admin.platform.service.RoleMenuElementService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RoleMenuElementServiceImpl implements RoleMenuElementService {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private RoleMenuElementDao roleMenuElementDao;

    @Override
    public void saveOrUpdate(RoleMenuElement menuElement) {
        roleMenuElementDao.saveOrUpdate(menuElement);
    }

    @Override
    public List<RoleMenuElement> findList(Map<String, Object> paraMap) {
        return roleMenuElementDao.findList(paraMap);
    }

    @Override
    public void save(List<RoleMenuElement> roleMenuElementList) {
        roleMenuElementDao.save(roleMenuElementList);
    }

    @Override
    public void del(int roId) {
        roleMenuElementDao.del(roId);
    }

    @Override
    public List<Element> findElementListByRoleMenurId(Map<String, Object> paraMap) {
        return roleMenuElementDao.findElementListByRoleMenurId(paraMap);
    }

    @Override
    public List<Element> findElementListByRoleId(List<RoleMenu> roleMenuList) {
        return roleMenuElementDao.findElementListByRoleId(roleMenuList);
    }

    public RoleMenuElementDao getRoleMenuElementDao() {
        return roleMenuElementDao;
    }

    public void setRoleMenuElementDao(RoleMenuElementDao roleMenuElementDao) {
        this.roleMenuElementDao = roleMenuElementDao;
    }

    @Override
    public void delByMenuId(Integer menuid) {
        roleMenuElementDao.delByMenuId(menuid);
    }
}
